home *** CD-ROM | disk | other *** search
/ SGI Hot Mix 8 / Hot Mix 8.iso / .all / demos / ICS / install.lm (.txt) < prev    next >
Text File  |  1994-06-22  |  22KB  |  994 lines

  1. #!/bin/sh
  2.  
  3. #
  4. # create a heirarchy of directories (mkdir that makes everything)
  5. # taken from the X11 distribution script mkdirhier.sh 
  6.  
  7. Mkdirhier()
  8. {
  9.   for f in $*
  10.     do
  11.     parts=`echo $f | sed 's,\(.\)/\(.\),\1 \2,g' | sed 's,/$,,'`
  12.     path="";
  13.     for p in $parts
  14.       do
  15.       if [ x"$path" = x ]
  16.     then
  17.     dir=$p
  18.       else
  19.     dir=$path/$p;
  20.       fi
  21.       if [ ! -d $dir ]
  22.     then
  23.     mkdir $dir
  24.     chmod a+rx $dir
  25.       fi
  26.       path=$dir
  27.     done
  28.   done
  29. }
  30.  
  31. Log()
  32. {
  33.   echo $1 >> $LOGFILE
  34.   echo $1
  35. }
  36.  
  37. Clear()
  38. {
  39.   echo ""
  40.   echo ""
  41.   echo ""
  42.   echo ""
  43.   echo ""
  44.   echo ""
  45.   echo ""
  46.   echo ""
  47.   echo ""
  48.   echo ""
  49.   echo ""
  50.   echo ""
  51.   echo ""
  52.   echo ""
  53.   echo ""
  54.   echo ""
  55.   echo ""
  56.   echo ""
  57.   echo ""
  58.   echo ""
  59.   echo ""
  60.   echo ""
  61.   echo ""
  62.   echo ""
  63. }
  64.  
  65. Title()
  66. {
  67.   echo "================================================================================"
  68.   echo "$1"
  69.   echo "================================================================================"
  70. }
  71.  
  72. Status()
  73. {
  74.   echo ""
  75.   echo "[1] License Data File Directory:        ${LMLICDIR}"
  76.   echo "[2] License Data File Name:             ${LMLICFILE}"
  77. }
  78.  
  79. AssignServer()
  80. {
  81.   case "$SERVERCOUNT"
  82.     in
  83.     1)
  84.       SERVER1="$1"
  85.     ;;
  86.     2)
  87.       SERVER2="$1"
  88.     ;;
  89.     3)
  90.       SERVER3="$1"
  91.     ;;
  92.     4)
  93.       SERVER4="$1"
  94.     ;;
  95.     5)
  96.       SERVER5="$1"
  97.     ;;
  98.     *)
  99.     ;;
  100.   esac
  101. }
  102.  
  103. AssignId()
  104. {
  105.   case "$SERVERCOUNT"
  106.     in
  107.     1)
  108.       ID1="$1"
  109.     ;;
  110.     2)
  111.       ID2="$1"
  112.     ;;
  113.     3)
  114.       ID3="$1"
  115.     ;;
  116.     4)
  117.       ID4="$1"
  118.     ;;
  119.     5)
  120.       ID5="$1"
  121.     ;;
  122.     *)
  123.     ;;
  124.   esac
  125. }
  126.  
  127. AssignPort()
  128. {
  129.   case "$SERVERCOUNT"
  130.     in
  131.     1)
  132.       PORT1="$1"
  133.     ;;
  134.     2)
  135.       PORT2="$1"
  136.     ;;
  137.     3)
  138.       PORT3="$1"
  139.     ;;
  140.     4)
  141.       PORT4="$1"
  142.     ;;
  143.     5)
  144.       PORT5="$1"
  145.     ;;
  146.     *)
  147.     ;;
  148.   esac
  149. }
  150.  
  151. Output()
  152. {
  153.   if test "$SINK" = "screen"
  154.     then
  155.     echo "        $@"
  156.   elif test "$1" != ""
  157.     then
  158.     echo $@ >> ${LMLICDIR}/${LMLICFILE}
  159.   fi
  160.         
  161. ServerList()
  162. {
  163.   if test "$1" != ""
  164.     then
  165.     SINK="datafile"
  166.   else
  167.     SINK="screen"
  168.     echo ""
  169.     echo "License Server List:"
  170.     echo ""
  171.   fi
  172.  
  173.   case "`expr $SERVERCOUNT - 1`" 
  174.     in
  175.     5)
  176.       Output "SERVER ${SERVER1} ${ID1} ${PORT1}"
  177.       Output "SERVER ${SERVER2} ${ID2} ${PORT2}"
  178.       Output "SERVER ${SERVER3} ${ID3} ${PORT3}"
  179.       Output "SERVER ${SERVER4} ${ID4} ${PORT4}"
  180.       Output "SERVER ${SERVER5} ${ID5} ${PORT5}"
  181.     ;;
  182.     4)
  183.       Output "SERVER ${SERVER1} ${ID1} ${PORT1}"
  184.       Output "SERVER ${SERVER2} ${ID2} ${PORT2}"
  185.       Output "SERVER ${SERVER3} ${ID3} ${PORT3}"
  186.       Output "SERVER ${SERVER4} ${ID4} ${PORT4}"
  187.       Output ""
  188.     ;;
  189.     3)
  190.       Output "SERVER ${SERVER1} ${ID1} ${PORT1}"
  191.       Output "SERVER ${SERVER2} ${ID2} ${PORT2}"
  192.       Output "SERVER ${SERVER3} ${ID3} ${PORT3}"
  193.       Output ""
  194.       Output ""
  195.     ;;
  196.     2)
  197.       Output "SERVER ${SERVER1} ${ID1} ${PORT1}"
  198.       Output "SERVER ${SERVER2} ${ID2} ${PORT2}"
  199.       Output ""
  200.       Output ""
  201.       Output ""
  202.     ;;
  203.     1)
  204.       Output "SERVER ${SERVER1} ${ID1} ${PORT1}"
  205.       Output ""
  206.       Output ""
  207.       Output ""
  208.       Output ""
  209.     ;;
  210.     0)
  211.       Output ""
  212.       Output ""
  213.       Output ""
  214.       Output ""
  215.       Output ""
  216.     ;;
  217.     *)
  218.     ;;
  219.   esac
  220. }
  221.  
  222. PromptUser()
  223. {
  224.   CONTINUE=NO
  225.   while test "$CONTINUE" = "NO"
  226.     do
  227.     echo "$1 (? for Help)"
  228.     echo ${DASHN} "[$2]->${SLASHC}"
  229.     read INPUT
  230.     case "$INPUT"
  231.       in
  232.       \?)
  233.         InstallHelp
  234.       ;;
  235.       *)
  236.         if test "$INPUT" = ""
  237.       then
  238.       USERPROMPT="$2"
  239.     else
  240.       USERPROMPT="$INPUT"
  241.     fi
  242.     CONTINUE=YES
  243.       ;;
  244.     esac
  245.   done
  246. }
  247.  
  248. AwaitEnter()
  249. {
  250.   ESCAPE=N
  251.   echo ${DASHN} "Press [ENTER] to continue [X] to escape...${SLASHC}"
  252.   read INPUT
  253.   case "$INPUT"
  254.     in
  255.     [xX])
  256.       ESCAPE=Y
  257.     ;;
  258.     *)
  259.       ESCAPE=N
  260.     ;;
  261.   esac
  262. }
  263.  
  264. InstallHelp()
  265. {
  266.   Title "Flexible License Manager Installation Help:  $HELPTITLE"
  267.   case "$HELP"
  268.     in
  269.     lmdir)
  270.       echo ""
  271.       echo ""
  272.       echo ""
  273.       echo ""
  274.       echo ""
  275.       echo "The BX Home Directory is the directory containing the various license manager"
  276.       echo "binary files.  The directory entered here should be the directory directly"
  277.       echo "preceding 'bin' for this architecture.  For example, if you have installed"
  278.       echo "the Builder Xcessory in /tools/BX and have not modified the directory"
  279.       echo "structure, you would enter '/tools/BX' for this value.  If you have modified"
  280.       echo "the BX directory structure such that the binaries are in architecture specific"
  281.       echo "directories, for example'/tools/BX/sun4/bin' and '/tools/BX/dec/bin' you would"
  282.       echo "enter '/tools/BX/sun4' for this value (if installing on a SPARC architecture."
  283.       echo ""
  284.       echo ""
  285.       echo ""
  286.       echo ""
  287.       echo ""
  288.       echo ""
  289.       echo ""
  290.       AwaitEnter
  291.     ;;
  292.     flmmain)
  293.       echo ""
  294.       echo ""
  295.       echo ""
  296.       echo "License Data File Directory        - indicates the directory where the license"
  297.       echo "                                     data file will be placed (or is located)."
  298.       echo "                                     If this directory is changed, the"
  299.       echo "                                     shell environment variable"
  300.       echo "                                     'LM_LICENSE_FILE' will have to be set in"
  301.       echo "                                     order for BX to find the licensing data."
  302.       echo ""
  303.       echo "License Data File Name             - indicates the name of the file containing"
  304.       echo "                                     the licensing data.  If this name is"
  305.       echo "                                     changed, the environment variable"
  306.       echo "                                     'LM_LICENSE_FILE' will have to be set in"
  307.       echo "                                     order for BX to find the licensing data."
  308.       echo ""
  309.       echo ""
  310.       echo ""
  311.       echo ""
  312.       echo ""
  313.       AwaitEnter
  314.     ;;
  315.     servers)
  316.       echo ""
  317.       echo ""
  318.       echo ""
  319.       echo "The server list is the list of LICENSE servers.  It is not necessarily the"
  320.       echo "list of machines on which the Builder Xcessory will be run.  When selecting"
  321.       echo "a set of machines to act as license servers, consider the following.  For"
  322.       echo "a small number of licenses, a single machine is normally sufficient.  The"
  323.       echo "license manager works on a quorum system.  A majority of the systems listed"
  324.       echo "as license servers must be running the license manager daemons in order for"
  325.       echo "any licenses to be granted.  For this reason, it is recommended that you use"
  326.       echo "either a single machine as your server or that you use three or more.  Two"
  327.       echo "license server machines is, perhaps, the worst configuration since if any"
  328.       echo "one of the machines listed is not running the license server, there will"
  329.       echo "no longer be a quorum and no licenses will be granted.  For larger"
  330.       echo "installations, three license server machines is the number recommended by"
  331.       echo "Highland Software."
  332.       echo ""
  333.       echo ""
  334.       echo ""
  335.       AwaitEnter
  336.     ;;
  337.     daemon)
  338.       echo ""
  339.       echo "The DAEMON line of the license data file indicates where to find the binary"
  340.       echo "for the specified vendor daemon.  It is the vendor daemon which actually"
  341.       echo "grants licenses for a particular software vendor's products.  The lmgrd"
  342.       echo "passes all requests for licenses to the appropriate vendor daemon.  The ICS"
  343.       echo "vendor daemon registers its name as 'ICSBX'.  The format for a DAEMON line in"
  344.       echo "the license data file is:"
  345.       echo ""
  346.       echo "        DAEMON ICSBX <path>/ICSBX"
  347.       echo ""
  348.       echo "A line beginning with 'DAEMON ICSBX' exists in the license data file you have"
  349.       echo "specified.  You should verify that the <path> portion of the line correctly"
  350.       echo "points to where you plan to install the license manager daemons."
  351.       echo ""
  352.       echo "NOTE:  This line may be edited after installing the license manager.  Its only"
  353.       echo "       purpose is to point to the correct vendor daemon.  Changing the line,"
  354.       echo "       however, will necessitate restarting the license manager system."
  355.       echo ""
  356.       echo ""
  357.       echo ""
  358.       AwaitEnter
  359.     ;;
  360.     *)
  361.     ;;
  362.   esac
  363.   Clear
  364. }
  365.  
  366. SYSTEM=sgi5
  367. DASHN=-n
  368. SLASHC=" "
  369. SHORT_NAMES=n
  370. LN="ln -s"
  371. MKDIR="mkdir -p"
  372. LMVERSION=2.21
  373. case "$SYSTEM"
  374.   in
  375.   sun4-cd | sun4 | sun4f )
  376.     LMHOSTNM=`/bin/hostname`
  377.     SYSTYPE="bsd"
  378.   ;;
  379.   ds3100 | ds3100-cd )
  380.     LMHOSTNM=`/bin/hostname`
  381.     DASHN=""
  382.     SLASHC=" \c"
  383.     SYSTYPE="bsd"
  384.   ;;
  385.   osf | osf-cd )
  386.     DASHN=""
  387.     SLASHC=" \c"
  388.     LMHOSTNM=`/bin/hostname`
  389.     SYSTYPE="other"
  390.   ;;
  391.   sgi | sgi-cd | sgi5 | sgi5-cd )
  392.     DASHN=""
  393.     SLASHC=" \c"
  394.     LMHOSTNM=`/usr/bsd/hostname`
  395.     SYSTYPE="sysv"
  396.   ;;
  397.   hp700 | hp700-cd )
  398.     LMHOSTNM=`/bin/hostname`
  399.     DASHN=""
  400.     SLASHC=" \c"
  401.     SHORT_NAMES=y
  402.     SYSTYPE="other"
  403.   ;;
  404.   ibm | ibm-cd)
  405.     DASHN=""
  406.     SLASHC=" \c"
  407.     LMHOSTNM=`/bin/hostname`
  408.     MKDIR="Mkdirhier"
  409.     SYSTYPE="other"
  410.   ;;
  411.   sco | sco-cd)
  412.     DASHN=""
  413.     SLASHC=" \c"
  414.     SHORT_NAMES=y
  415.     LN="cp"
  416.     LMHOSTNM=`/usr/bin/hostname`
  417.     SYSTYPE="sysv"
  418.   ;;
  419.   mips | mips-cd)
  420.     DASHN=""
  421.     SLASHC=" \c"
  422.     LMHOSTNM=`/usr/net/hostname`
  423.     SYSTYPE="other"
  424.   ;;
  425.   *)
  426.     LMHOSTNM=`/bin/hostname`
  427.     SYSTYPE="other"
  428.   ;;
  429. esac
  430.  
  431. CONT="NO"
  432. if test "${SHORT_NAMES}" = "y"
  433.   then
  434.   BXDIR=/usr/lib/X11/bX
  435. else
  436.   BXDIR=/usr/lib/X11/builderXcessory
  437. fi    
  438. LMLICDIR=/usr/local/flexlm/licenses
  439. LMLICFILE=license.dat
  440. LMDEFAULT=${LMLICDIR}/${LMLICFILE}
  441. DAEMON="DAEMON ICSBX"
  442. FEATUREVER="FEATURE BuilderXcessoryDemo ICSBX"
  443.  
  444. if test "$1" = ""
  445.   then
  446.   Clear
  447.   Title "Flexible License Manager Installation"
  448.   echo ""
  449.   HELP="lmdir"
  450.   HELPTITLE="BX Home Directory"
  451.   PromptUser "Enter the BX Home Directory." "${BXDIR}"
  452.   BXDIR=${USERPROMPT}
  453. else
  454.   BXDIR=$1
  455. fi
  456. LMDIR=${BXDIR}/bin
  457.  
  458. SERVERPORT=1700 
  459. DEFAULTSERVER=${LMHOSTNM}
  460. if test -x ${LMDIR}/lmhostid
  461.   then
  462.   DEFAULTID=`${LMDIR}/lmhostid | awk -F\" '/\".*\"/ {printf "%s", $2}' -`
  463. else
  464.   DEFAULTID="UNKNOWN"
  465. fi
  466.  
  467. CONT=NO
  468. while test "${CONT}" = "NO"
  469.   do
  470.   HELP="flmmain"
  471.   HELPTITLE="Main Menu"
  472.   Clear
  473.   Title "Flexible License Manager Installation"
  474.   Status
  475.   echo ""
  476.   echo ""
  477.   echo ""
  478.   echo ""
  479.   echo ""
  480.   echo ""
  481.   echo ""
  482.   echo 1. Change license data file directory.
  483.   echo 2. Change license data file name.
  484.   echo I. Continue installation.
  485.   echo Q. Quit.
  486.   echo ""
  487.   echo ""
  488.   echo ""
  489.   echo ""
  490.   echo ""
  491.   echo ""
  492.   echo ${DASHN} "Selection (? for Help):${SLASHC}"
  493.   read Z
  494.   echo ""
  495.   case "$Z"
  496.     in
  497.     [Qq])
  498.       echo Quit by user from menu.
  499.       exit
  500.     ;;
  501.     [Ii])
  502.       CONT=YES
  503.     ;;
  504.     \?)
  505.       InstallHelp
  506.     ;;
  507.     1)
  508.       PromptUser "Enter new license data file directory." "${LMLICDIR}"
  509.       LMLICDIR="$USERPROMPT"
  510.     ;;
  511.     2)
  512.       PromptUser "Enter new license data file name." "${LMLICFILE}"
  513.       LMLICFILE="$USERPROMPT"
  514.     ;;
  515.     *)
  516.     ;;
  517.   esac
  518. done
  519.  
  520. if [ -d "${LMLICDIR}" ]
  521.   then
  522.   echo ${DASHN}
  523. else
  524.   ${MKDIR} ${LMLICDIR}
  525. fi
  526.  
  527. if [ -f "${LMLICDIR}/${LMLICFILE}" ]
  528.   then
  529.   CONT=NO
  530.   while test "${CONT}" = "NO"
  531.     do
  532.     Clear
  533.     Title "Flexible License Manager - Server List"
  534.     echo ""
  535.     PromptUser "Do you want to use the existing file to get your server data?" "y"
  536.     case "$USERPROMPT" 
  537.       in
  538.       [Nn] | [Nn][Oo])
  539.         echo ""
  540.     echo ""
  541.     echo ""
  542.     echo "Renaming ${LMLICDIR}/${LMLICFILE} to"
  543.     echo "         ${LMLICDIR}/${LMLICFILE}.old"
  544.     mv ${LMLICDIR}/${LMLICFILE} ${LMLICDIR}/${LMLICFILE}.old
  545.     echo ""
  546.     NEEDSERVERS=YES
  547.     CONT=YES
  548.     echo ""
  549.     echo ""
  550.     echo ""
  551.     echo ""
  552.     AwaitEnter
  553.       ;;
  554.  
  555.       [Yy] | [Yy][Ee] | [Yy][Ee][Ss])
  556.         NEEDSERVERS=NO
  557.     CONT=YES
  558.       ;;
  559.       *)
  560.         echo ""
  561.     echo "Please answer \`y\` or \`n\`"
  562.     CONT=NO
  563.       ;;
  564.     esac
  565.   done
  566. else
  567.   NEEDSERVERS=YES
  568. fi
  569.  
  570. if test "${NEEDSERVERS}" = "YES"
  571.   then
  572.   Clear
  573.   Title "Flexible License Manager - Server List"
  574.   echo ""
  575.   echo ""
  576.   echo ""
  577.   echo ""
  578.   echo "You will need to enter the hostname, hostid, and TCP/IP services port number"
  579.   echo "to use for each system you would like to use as a license server.  Use the"
  580.   echo "\"lmhostid\" command to determine the hostid to use.  You may enter a maximum"
  581.   echo "of five hostname/hostid/tcpip port triplets."
  582.   echo ""
  583.   echo "For more information on license server specifications, see the accompanying"
  584.   echo "documentation on configuring the license manager."
  585.   echo ""
  586.   echo "NOTE:  If you do not yet have a BX License Activation Key,"
  587.   echo "       you may simply use the initial default values and fill"
  588.   echo "       in the remaining servers at your leisure."
  589.   echo ""
  590.   echo ""
  591.   echo ""
  592.   echo ""
  593.   echo ""
  594.   AwaitEnter
  595.  
  596.   SERVERCOUNT=1
  597.   while test "${NEEDSERVERS}" = "YES" -a $SERVERCOUNT -le 5
  598.     do
  599.     HELP="servers"
  600.     HELPTITLE="License Server List"
  601.     Clear
  602.     Title "Flexible License Manager - Server List"
  603.     ServerList
  604.     
  605.     echo ""
  606.     echo "Press ENTER at the hostname prompt to terminate the server list"
  607.     echo ""
  608.     PromptUser "License Server hostname" "${DEFAULTSERVER}"
  609.     if test "$USERPROMPT" != ""
  610.       then
  611.       AssignServer "$USERPROMPT"
  612.       SERVERNAME=$USERPROMPT
  613.       DEFAULTSERVER=""
  614.     elif [ $SERVERCOUNT -eq 1 ]
  615.       then
  616.       DEFAULTSERVER=$LMHOSTNM
  617.       NEEDSERVERS=YES
  618.     else
  619.       NEEDSERVERS=NO
  620.     fi
  621.     
  622.     if test "$NEEDSERVERS" = "YES"
  623.       then
  624.       CONT=NO
  625.       while test "$CONT" = "NO"
  626.     do
  627.     PromptUser "Host ID of ${SERVERNAME}" "${DEFAULTID}"
  628.     if test "$USERPROMPT" != ""
  629.       then
  630.       AssignId "$USERPROMPT"
  631.       SERVERID=$USERPROMPT
  632.       DEFAULTID=""
  633.       CONT=YES
  634.     elif [ $SERVERCOUNT != 1 ]
  635.       then
  636.       echo "Please Enter a Host ID"
  637.       CONT=NO
  638.     else
  639.       CONT=YES
  640.     fi
  641.       done
  642.       
  643.       PromptUser "TCP/IP Port to use on ${SERVERNAME}" "${SERVERPORT}"
  644.       if test "$USERPROMPT" != ""
  645.     then
  646.     AssignPort "$SERVERPORT"
  647.     SERVERPORT=$USERPROMPT
  648.       fi
  649.       CONT=YES
  650.  
  651.       echo ""
  652.       CONT=NO
  653.       SERVERCOUNT=`expr $SERVERCOUNT + 1`
  654.       while test "$CONT" = "NO"
  655.     do
  656.     PromptUser "SERVER ${SERVERNAME} ${SERVERID} ${SERVERPORT}.  Is this correct" "y"
  657.     case "$USERPROMPT" 
  658.       in
  659.       [Nn] | [Nn][Oo])
  660.         SERVERCOUNT=`expr $SERVERCOUNT - 1`
  661.         DEFAULTSERVER="$SERVERNAME"
  662.         CONT=YES
  663.       ;;
  664.  
  665.       [Yy] | [Yy][Ee] | [Yy][Ee][Ss])
  666.         CONT=YES
  667.       ;;
  668.       *)
  669.         SERVERCOUNT=`expr $SERVERCOUNT - 1`
  670.         echo "Please answer \`y\` or \`n\`"
  671.         CONT=NO
  672.       ;;
  673.     esac
  674.       done
  675.     fi
  676.   done
  677.               
  678.   Clear
  679.   Title "Flexible License Manager - Server List"
  680.   ServerList
  681.  
  682.   echo ""
  683.   echo ""
  684.   echo "The preceding license server list has been added to the license data file."
  685.   echo ""
  686.   echo ""
  687.   echo ""
  688.   echo ""
  689.   echo ""
  690.   echo ""
  691.   echo ""
  692.   echo ""
  693.   echo ""
  694.  
  695.   ServerList 1
  696.   AwaitEnter
  697. fi
  698.  
  699. grep "$DAEMON" ${LMLICDIR}/${LMLICFILE} > /dev/null 2>&1
  700. if [ $? -ne 0 ]
  701.   then
  702.   SINK="datafile"
  703.   Output "${DAEMON} ${LMDIR}/ICSBX"
  704. else
  705.   CONT=NO
  706.   while test "$CONT" = "NO"
  707.     do
  708.     Clear
  709.     Title "Flexible License Manager Installation"
  710.     echo ""
  711.     HELP="daemon"
  712.     HELPTITLE="DAEMON Specification"
  713.     echo "An ICSBX license daemon specification already exists in"
  714.     echo "${LMLICDIR}/${LMLICFILE}"
  715.     echo ""
  716.     echo "The current specification is:"
  717.     echo ""
  718.     echo ${DASHN} "        "
  719.     echo `grep "$DAEMON" ${LMLICDIR}/${LMLICFILE}`
  720.     echo ""
  721.     PromptUser "Do you want to keep the old specification?" "y"
  722.     case "$USERPROMPT" 
  723.       in
  724.       [Nn] | [Nn][Oo])
  725.         SINK="datafile"
  726.     egrep -ve "$DAEMON" ${LMLICDIR}/${LMLICFILE} >> ${LMLICDIR}/tmp.dat
  727.     echo "${DAEMON} ${LMDIR}/ICSBX" >> ${LMLICDIR}/tmp.dat
  728.     mv ${LMLICDIR}/tmp.dat ${LMLICDIR}/${LMLICFILE}
  729.     CONT=YES
  730.       ;;
  731.  
  732.       [Yy] | [Yy][Ee] | [Yy][Ee][Ss])
  733.         CONT=YES
  734.       ;;
  735.  
  736.       *)
  737.         echo "Please answer \`y\` or \`n\`"
  738.     CONT=NO
  739.       ;;
  740.     esac
  741.   done
  742.   AwaitEnter
  743. fi
  744.  
  745. if ( test "${LMLICDIR}/${LMLICFILE}" != "${LMDEFAULT}" )
  746.   then
  747.   LMGRDCMD="${LMDIR}/lmgrd -c ${LMLICDIR}/${LMLICFILE}"
  748.   NONDEFAULT=YES
  749. else
  750.   LMGRDCMD="${LMDIR}/lmgrd"
  751.   NONDEFAULT=NO
  752. fi
  753.  
  754. Clear
  755. Title "Boot Script Installation"
  756. if ( test "${SYSTYPE}" != "other" )
  757.   then
  758.   echo ""
  759.   echo "This script can install the scripts necessary to start the license manager"
  760.   echo "when this system is rebooted.  If this system is not being used as a license"
  761.   echo "server, you may choose to skip this installation.  For those who prefer,"
  762.   echo "sample boot scripts for System V and BSD systems are available in"
  763.   echo "${BXDIR}/examples/lm.sysv and"
  764.   echo "${BXDIR}/examples/lm.bsd"
  765.   echo ""
  766.   if ( test "${SYSTYPE}" = "sysv" )
  767.     then
  768.     echo "On this system the lm.sysv file will be customized with the information"
  769.     echo "you have provided here.  It will be copied to /etc/init.d/icslmgr and the"
  770.     echo "symbolic links /etc/rc2.d/S76icslmgr and /etc/rc0.d/K30icslmgr will be made."
  771.   else
  772.     echo "On this system the lm.bsd file will be customized with the information"
  773.     echo "you have provided here.  It will then be appended to the system boot file --"
  774.     echo "rc.local.  A copy of rc.local will be saved in rc.local.old"
  775.   fi
  776.   echo ""
  777.   echo ""
  778.   
  779.   HELP="boot"
  780.   HELPTITLE="Boot Script Installation"
  781.   PromptUser "Do you want to install the boot scripts?" "y"
  782.   CONT=NO
  783.   while test "${CONT}" = "NO"
  784.     do
  785.     case "$USERPROMPT" 
  786.       in
  787.       [Nn] | [Nn][Oo])
  788.         BOOTINSTALL=NO
  789.     CONT=YES
  790.       ;;
  791.       [Yy] | [Yy][Ee] | [Yy][Ee][Ss])
  792.         BOOTINSTALL=YES
  793.     CONT=YES
  794.       ;;
  795.       *)
  796.         echo "Please answer \`y\` or \`n\`"
  797.     CONT=NO
  798.       ;;
  799.     esac
  800.   done
  801. else
  802.   echo ""
  803.   echo "This script cannot install the scripts necessary to start the license manager"
  804.   echo "when this system is rebooted.  If this system is being used as a license"
  805.   echo "server, you will have to modify the system boot scripts manually.  Sample"
  806.   echo "boot scripts for System V and BSD systems are available in"
  807.   echo "${BXDIR}/examples/lm.sysv and"
  808.   echo "${BXDIR}/examples/lm.bsd"
  809.   echo ""
  810.   echo ""
  811.   echo ""
  812.   AwaitEnter
  813.   BOOTINSTALL=NO
  814. fi
  815.  
  816. LMLOGFILE="${LMLICDIR}/flexlm.log"
  817. if ( test "${BOOTINSTALL}" = "YES" )
  818.   then
  819.   HELP="logfile"
  820.   HELPTITLE="License Manager Log File"
  821.   PromptUser "Enter the log file for the license manager" "${LMLOGFILE}"
  822.   LMLOGFILE="$USERPROMPT"
  823.   sed -e "s?LOG_FILE_NAME?${LMLOGFILE}?g" ${BXDIR}/examples/lm.${SYSTYPE} | sed -e "s?LMGR_LOCATION?${LMDIR}?g" | sed -e "s?LICENSE_FILE?${LMLICDIR}/${LMLICFILE}?g" > /tmp/lmboot
  824.  
  825.   if ( test "${SYSTYPE}" = "sysv" )
  826.     then
  827.     if test -x /etc/init.d/icslmgr
  828.       then
  829.       mv /etc/init.d/icslmgr /etc/init.d/icslmgr.old
  830.     fi
  831.     
  832.     mv /tmp/lmboot /etc/init.d/icslmgr
  833.     chmod 755 /etc/init.d/icslmgr
  834.  
  835.     if test -x "/etc/rc2.d/S76icslmgr"
  836.       then
  837.       rm -f /etc/rc2.d/S76icslmgr
  838.     fi
  839.     ${LN} /etc/init.d/icslmgr /etc/rc2.d/S76icslmgr
  840.     if test -x "/etc/rc0.d/K30icslmgr"
  841.       then
  842.       rm -f /etc/rc0.d/K30icslmgr
  843.     fi
  844.     ${LN} /etc/init.d/icslmgr /etc/rc0.d/K30icslmgr
  845.   else
  846.     cp /etc/rc.local /etc/rc.local.old
  847.     cat /tmp/lmboot >> /etc/rc.local
  848.     rm -f /tmp/lmboot
  849.   fi
  850.  
  851.   echo ""
  852.   echo "License Manager Boot Time start scripts installed."
  853.   echo ""
  854.   echo ""
  855.   AwaitEnter
  856. fi
  857.  
  858. Clear
  859. Title "Start the Flexible License Manager"
  860. HELP="startlm"
  861. HELPTITLE="Start License Manager"
  862. PromptUser "Do you want to start the License Manager on this machine?" "y"
  863.  
  864. CONT=NO
  865. while test "${CONT}" = "NO"
  866.   do
  867.   case "$USERPROMPT" 
  868.     in
  869.     [Nn] | [Nn][Oo])
  870.       STARTLM=NO
  871.       CONT=YES
  872.     ;;
  873.     [Yy] | [Yy][Ee] | [Yy][Ee][Ss])
  874.       STARTLM=YES
  875.       CONT=YES
  876.     ;;
  877.     *)
  878.       echo "Please answer \`y\` or \`n\`"
  879.       CONT=NO
  880.     ;;
  881.   esac
  882. done
  883.  
  884. if ( test "${STARTLM}" = "YES" )
  885.   then
  886.   HELP="logfile"
  887.   HELPTITLE="License Manager Log File"
  888.   PromptUser "Enter the log file for the license manager" "${LMLOGFILE}"
  889.   LMLOGFILE="$USERPROMPT"
  890.     
  891.   ${LMGRDCMD} > ${LMLOGFILE} &
  892.   echo ""
  893.   echo "See ${LMLOGFILE} for License Manager status."
  894.   echo ""  
  895.   AwaitEnter
  896. fi
  897.  
  898. Title "Starting the Flexible License Manager"
  899. echo ""
  900. echo ""
  901. echo ""
  902. echo ""
  903. echo ""
  904. echo ""
  905. echo "To start the the License Manager manually, use the following command"
  906. echo "line:"
  907. echo ""
  908. echo ""
  909. echo "    ${LMGRDCMD} > ${LMLOGFILE} &"
  910. echo ""
  911. echo ""
  912. echo ""
  913. echo ""
  914. echo ""
  915. echo ""
  916. echo ""
  917. echo ""
  918. echo ""
  919. AwaitEnter
  920.  
  921. if test "${NONDEFAULT}" = "YES"
  922.   then
  923.   Title "I M P O R T A N T    N O T E"
  924.   echo ""
  925.   echo ""
  926.   echo ""
  927.   echo ""
  928.   echo ""
  929.   echo ""
  930.   echo "    Because you have installed the license file in a non-default"
  931.   echo "    directory or with a non-default name, you will have to set the"
  932.   echo "    LM_LICENSE_FILE environment variable when running the Builder"
  933.   echo "    Xcessory.  See the Builder Xcessory documentation for more"
  934.   echo "    information regarding the use of this environment variable."
  935.   echo ""
  936.   echo ""
  937.   echo ""
  938.   echo ""
  939.   echo ""
  940.   echo ""
  941.   echo ""
  942.   echo ""
  943.   echo ""
  944.   AwaitEnter
  945. fi
  946.  
  947. Title "Full Use Licenses"
  948. echo ""
  949. echo ""
  950. echo ""
  951. echo ""
  952. echo ""
  953. echo "If you have purchased a full functionality license, please"
  954. echo "contact your ICS Technical Support for your license keys."
  955. echo ""
  956. echo ""
  957. echo "Please provide the following information:"
  958. echo ""
  959. echo "        serial number from your Builder Xcessory media"
  960. echo "        hostname of EACH license server machine"
  961. echo "        hostid of EACH license server machine"
  962. echo ""
  963. echo ""
  964. echo ""
  965. echo ""
  966. echo ""
  967. echo ""
  968.  
  969. AwaitEnter
  970.  
  971. Clear
  972. Title "Where to Get More Information"
  973. echo ""
  974. echo ""
  975. echo ""
  976. echo ""
  977. echo ""
  978. echo "The installation of the BX License Manager is complete.  The license file is"
  979. echo "${LMLICDIR}/${LMLICFILE}."
  980. echo ""
  981. echo "This file should be modified to add additional license servers."
  982. echo "See the accompanying Builder Xcessory documentation for more information"
  983. echo "regarding the modification of the license file."
  984. echo ""
  985. echo ""
  986. echo ""
  987. echo ""
  988. echo ""
  989. echo ""
  990. echo ""
  991. echo ""
  992. echo ""
  993.